{% extends 'basic.html' %}
{% block title %}开课登记{% endblock %}
{% block content %}
{% load static %}
<h3>开课登记</h3>
<form id="reg-course-form" enctype="multipart/form-data">
    {% csrf_token %}
    <!-- 课程编号 -->
    <label for="course-id">课程编号：</label>
    <input type="text" id="course-id" name="course_id" placeholder="请输入课程编号" required>
    <!-- 课程名称 -->
    <label for="course-name">课程名称：</label>
    <input type="text" id="course-name" name="course_name" placeholder="请输入课程名称" required>
    <!-- 上传教材封面 -->
    <label for="course-cover">上传教材封面：</label>
    <input type="file" id="course-cover" name="course_cover" accept="image/*">
    <!-- 课程课时 -->
    <label for="course-hours">课程课时：</label>
    <input type="number" id="course-hours" name="course_hours" placeholder="请输入课程课时" required>
    <!-- 课程学分 -->
    <label for="course-credits">课程学分：</label>
    <input type="number" id="course-credits" name="course_credits" placeholder="请输入课程学分" required>
    <!-- 选择课程类型 -->
    <label for="course-type">课程类型：</label>
    <select id="course-type" name="course_type" required>
        {% for course_type in course_types %}
            <option value="{{ course_type.type_id }}">{{ course_type.type_name }}</option>
        {% empty %}
            <option value="">暂无课程类型</option>
        {% endfor %}
    </select>
    <!-- 课程状态 -->
    <label for="course-status">课程状态：</label>
    <select id="course-status" name="course_status" required>
        <option value="开放公选">开放公选</option>
        <option value="暂不开放">暂不开放</option>
        <option value="停止授课">停止授课</option>
    </select>
    <!-- 选课条件 -->
    <label>选课条件：</label>
    <div class="checkbox-group">
        <label><input type="checkbox" name="course_conditions" value="大三以上"> 大三以上</label>
        <label><input type="checkbox" name="course_conditions" value="平时成绩80"> 平时成绩80</label>
        <label><input type="checkbox" name="course_conditions" value="党员"> 党员</label>
        <label><input type="checkbox" name="course_conditions" value="未拖欠学费"> 未拖欠学费</label>
    </div>
    <!-- 备注说明 -->
    <label for="course-notes">备注说明：</label>
    <textarea id="course-notes" name="course_notes" rows="5" placeholder="请输入备注说明"></textarea>
    <!-- 提交按钮 -->
    <button type="submit" class="submit-btn">开设课程</button>
</form>
<div class="back-to-main">
    <a href="{% url 'main_page' %}" class="back-btn">返回主页面</a>
</div>
<link rel="stylesheet" href="{% static 'css/reg_course.css' %}">
<script src="{% static 'js/reg_course.js' %}"></script>
{% endblock %}